package com.mz.mattress.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mz.mattress.admin.api.req.MemberCardQueryReq;
import com.mz.mattress.admin.api.resp.IntegerCount;
import com.mz.mattress.api.entity.MemberCard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MemberCardMapper extends BaseMapper<MemberCard> {

    Page<MemberCard> listPage(Page page,
                              @Param("cardId") Integer cardId,
                              @Param("merchantId") Integer merchantId,
                              @Param("status") Integer status);

    Page<MemberCard> listAdminPage(Page page, MemberCardQueryReq req);


    List<IntegerCount> selectSum(@Param("merchantId") Integer merchantId, @Param("cardId") Integer cardId);

}
